#!/usr/bin/perl -w

# klokkesig-conv
# File ID: f9ddfe94-5d3d-11df-b4d3-90e6ba3022ac
# Konverterer obskure dataformater til ISO-8601.

use Time::Local;

my %mnd_str = (
	'Jan' => '01',
	'Feb' => '02',
	'Mar' => '03',
	'Apr' => '04',
	'May' => '05',
	'Jun' => '06',
	'Jul' => '07',
	'Aug' => '08',
	'Sep' => '09',
	'Oct' => '10',
	'Nov' => '11',
	'Dec' => '12'
);

while (<>) {
	s/
		(\d+)\s+
		(Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+
		(\d\d):(\d\d):(\d\d)
	/
		sprintf("%u", timegm($5, $4, $3, $1, $mnd_str{Mon-1}, 2002))
	/eix;
	print;
}
